package com.example.singletest.inventory;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RocketMQMessageListener(
        topic = "%DLQ%inventory-group",
        consumerGroup = "dlq-consumer"
)
public class DlqConsumer implements RocketMQListener<String> {
    /*
    * 死信消息
    * */
    @Override
    public void onMessage(String orderId) {
        log.error("死信消息，人工处理 orderId={}", orderId);
        // TODO: 发报警 / 入表
    }
}
